var htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
	//entry : ['./src/script/main.js' , './src/script/a.js'],

	entry: {
		main: './src/script/main.js',
		a: './src/script/a.js',
		b: './src/script/b.js',
		c: './src/script/c.js'
	},

	output: {
		path: __dirname + '/dist/',
		filename: 'js/[name]-[chunkhash].js',
		//发布
		publicPath: "http://cdn.com/"
	},

	plugins: [
		new htmlWebpackPlugin({
			filename: 'index-[hash].html',
			template: 'index.html',
			//发布
			inject: false,
			title: 'webpack is good',
			//发布
			minify: {
				removeComments: true,
				collapseWhitespace: true
			}
		}),
		new htmlWebpackPlugin({
			filename: 'a.html',
			template: 'index.html',
			chunks:['main', 'a'],
			//发布
			inject: false,
			title: 'webpack is a',
			//发布
			/*minify: {
				removeComments: true,
				collapseWhitespace: true
			}*/
		}),
		new htmlWebpackPlugin({
			filename: 'b.html',
			template: 'index.html',
			//发布
			inject: false,
			chunks:['main', 'b'],
			title: 'webpack is b',
			//发布
			/*minify: {
				removeComments: true,
				collapseWhitespace: true
			}*/
		}),
		new htmlWebpackPlugin({
			filename: 'c.html',
			template: 'index.html',
			//发布
			inject: false,
			title: 'webpack is c',
			chunks:['main', 'c'],
//			excludeChunks:['b'],
			//发布
			/*minify: {
				removeComments: true,
				collapseWhitespace: true
			}*/
		})
	]
}